package thinkinginjava.concurrency;

public class ExpensiveIniMain {
	static class ExpensiveIniGetter extends Thread{
		private String name;
		
		ExpensiveIniGetter(String name) {
			super();
			this.name = name;
		}
		
		public void run() {
			System.out.println(name + " starts getting expensive");
			ExpensiveInitial ei = ExpensiveInitial.getInstance();
			System.out.println(name + " finish. Size:" + ei.size());
		}
	}
	
	public static void main(String[] args) {
		ExpensiveInitial.simple();
		ExpensiveInitial.getInstance();
//		ExpensiveIniGetter g1 = new ExpensiveIniGetter("g1");
//		g1.start();
//		
//		ExpensiveIniGetter g2 = new ExpensiveIniGetter("g2");
//		g2.start();
	}
}
